FROM golang:1.21.5-alpine3.18 as builder

ENV CGO_ENABLED=1

RUN apk add --no-cache gcc musl-dev

ADD . /usr/src

RUN cd /usr/src && go build -mod=vendor

FROM alpine:3.18

RUN mkdir /workspace

WORKDIR /workspace

ENV LABEL_SYS_CONFIG_PATH=/workspace/config/config.yaml

COPY --from=builder /usr/src/demo /workspace/label-sys

ENTRYPOINT /workspace/label-sys
